package org.terramagnet.pdmviewer.parser;

public abstract class PDMObject {

	public abstract String getId();

	@Override
	public boolean equals(Object obj) {
		String thisId = getId();
		if (thisId == null) {
			return false;
		}
		if (obj == null || !(obj instanceof PDMObject)) {
			return false;
		}

		PDMObject that = (PDMObject) obj;
		return thisId.equals(that.getId());
	}

	@Override
	public int hashCode() {
		return getId() == null ? -9 : getId().hashCode();
	}

}
